namespace Framework
{
    public class Inverter<T> : Decorator<T>
    {
        public override TaskStatus Update(T context)
        {
            TaskStatus status = child.Tick(context);
            if (status == TaskStatus.Success)
            {
                return TaskStatus.Failure;
            }

            if (status == TaskStatus.Failure)
            {
                return TaskStatus.Success;
            }

            return TaskStatus.Running;
        }
    }
}